#!/usr/bin/env python
# coding: utf-8
# vim: fdm=marker fmr={{{,}}} cms=#%s#

class App:
    def main(self):
        self.__run()

    def __run(self):
        try:
            fh=open("test.jpg", "rb")
            buf=fh.read()
            fh.close()
            fh=open("test-2.jpg", "wb")
            fh.write(buf)
            fh.close()

            fh=open("test.xml", "r")
            lines=fh.readlines()
            fh.close()
            fh=open("test-2.xml", "w")
            fh.writelines(lines)
            fh.close()

            fh=open("test.xml")
            for line in fh:
#                print line
                pass
            fh.close()
        except Exception as e:
            print "Operate fail: %s" % e

if __name__ == "__main__":
    App().main()
